#include <cstdio>

void solve() {
	for (int i=1; i<=46; i++) {
		for (int j=i+2; j<=48; j++) {
			int sum = 1;
			for (int n=2; n<=49; n++) {
				if (n-1==i || n-1==j) {
					sum -= n-1;
					sum += (n-1)*n;
				} else {
					sum += n;
				}
			}
			if (sum == 2015) {
				printf("%d  %d\n", i, j);
			}
		}
	}
}

int main() {
	solve();
	return 0;
}
